#ifndef DATACONTAINER_H_
#define DATACONTAINER_H_

#include <QList>
#include <QString>
#include <QStringList>
#include <QDate>
class QStandardItemModel;
class Graph;

//an atomic data
class AtomicData : public QDate {
public:
	AtomicData(QDate &date);
	
	//QDate date;
	double avgPrice;
	double minPrice;
};

//single object
class ObjectData {
public:
	ObjectData( QString objName );
	
	QString name;
	QList <AtomicData> atomics;
}; 

// all data
class DataContainer {
public:
	DataContainer();
	int readFromCSV();
	int fillAvgModel(QStandardItemModel * avgModel);
	int fillMinModel(QStandardItemModel * minModel);
	int priceToGraph(QString name, Graph* graph);
	void comissionsToGraph(QDate date, Graph* graph);
	
	QStringList nameIndex;
	QStringList dateIndex;
private:
	QList <ObjectData*> objects;
};

#endif /*DATACONTAINER_H_*/
